<template>
	<view class="notic">
		<view class="list" v-if="list.length">
			<view class="notic_one" v-for="(item,index) in list" :key='index'>
				<view class="titles">{{item.title}}</view>
				<view class="content" @longpress='copyContent(item)' v-html='item.content'></view>
				<view class="time">{{item.create_time}}</view>
			</view>
		</view>
		<view class="list empty imgPublic" v-else>
			<image src="../static/images/empty.png" mode="widthFix"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[],
			};
		},
		onShow(){
			this.initNotic();
		},
		methods:{
			copyContent(notic){
				uni.setClipboardData({
					data:notic.content,
				})
			},
			initNotic(){
				this.tool.getData('User/messageList',{
					memberId: uni.getStorageSync('userId'),
				}).then(res=>{
					console.log(res);
					if(res){
						this.list = res.list;
					}
				}).catch(err=>{
					console.log(err);
				})
			}
		}
	}
</script>

<style lang="scss">
	.notic{
		width:100%;
		padding:12px;
		box-sizing: border-box;
		.notic_one{
			width:100%;
			background: white;
			padding:10px 12px;
			box-sizing: border-box;
			border-radius: 4px;
			margin-bottom: 12px;
			.time{
				font-size: 12px;
				color:#606266;
			}
			.content{
				width:100%;
				padding:10px ;
				box-sizing: border-box;
				color:#666666;
			}
			.titles{
				width:100%;
				padding-bottom: 10px;
				font-size: 13px;
				font-weight:bold;
				border-bottom: 1px solid rgba(0, 0, 00, 0.1);
			}
		}
	}
</style>
